<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Businessset/sysset_list')}">转盘中奖设置</a></li>
    </ul>
    <form id="myform6"  method="post" class="form-horizontal js-ajax-form" action="{:U('Businessset/randset_update')}"  method="post">
            <fieldset>
                    <!-- 里程费配置 -->
                    <h2 style="color: #f50;" align="center">奖项配置</h2>
                    <input type="button"  class="btn btn-primary" value="增加" id="addmileage" onClick="add_mileage_Div();" />
                    <input type="hidden" value="6" name="set_id">
                    <table id="div_mileage"  class="table table-hover table-bordered table-list">
                        <thead>
                        <tr>
                            <th width="10%">id号</th>
                            <th >最小角度</th>
                            <th >最大角度</th>
                            <th >奖项名称</th>
                            <th  >概率</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="datas" item="vo" key="k">
                            <tr >
                                <td><input style="width: 50px;" name="datas[{$k+1}][id]" type="text" value="{$vo.id}" required/>
                                </td>
                                <td ><input  style="width: 150px;" name="datas[{$k+1}][min]" type="text" value="{$vo.min}" required/>
                                </td>

                                <td><input  style="width: 150px;" name="datas[{$k+1}][max]" type="text" value="{$vo.max}"  required/>
                                </td>

                                <td><input  style="width: 350px;" name="datas[{$k+1}][prize]" type="text" value="{$vo.prize}" required/>
                                </td>

                                <td><input  style="width: 150px;" name="datas[{$k+1}][v]" type="text" value="{$vo.v}"  required/>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>

                        <div class="control-group">

                        </div>
                    </table>
                </fieldset>
        <div class="form-actions" align="right">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>

        function addDiv($count){
            var div=" <div>"+
                        "增 1 项:&nbsp;&nbsp;<input type=\"text\" name=\"text"+$count+"[]\" >"+
                        " </div>";
            var divchild = '#div_'+$count;
            $(divchild).append(div);
        };

        var mileage_count = 100;
        function add_mileage_Div(){
            var div ="新增：<tr >"+
                    "<td><input style=\"width: 50px;\" name=\"datas["+mileage_count+"][id]\" type=\"text\" required/>"+
                    "</td>"+
                    "<td ><input  style=\"width: 150px;\" name=\"datas["+mileage_count+"][min]\" type=\"text\" required/>"+
                    "</td>"+

                    "<td><input  style=\"width: 150px;\" name=\"datas["+mileage_count+"][max]\" type=\"text\"   required/>"+
                    "</td>"+

                    "<td><input  style=\"width: 350px;\" name=\"datas["+mileage_count+"][prize]\" type=\"text\"  required/>"+
                    "</td>"+

                    "<td><input  style=\"width: 150px;\" name=\"datas["+mileage_count+"][v]\" type=\"text\"  required/>"+
                    "</td>"+
                    "</tr>";

            $('#div_mileage').append(div);
            mileage_count++;
        };
</script>
</body>
</html>